package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.annotation.JoinField;
import com.qijian.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.List;

/**
 * 工艺变更明细对象 main_line_change_detail
 *
 * @author qijian
 * @date 2022-02-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("main_line_change_detail")
public class LineChangeDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "ID")
    @TableId
    private Long processId;


//    @JsonSerialize(using = ToStringSerializer.class)
//    @ApiModelProperty(value = "上版本id（本类）")
//    private Long lastVersionId;


    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "来源id")
    private Long sourceId;

    /**
     * 类型（1-旧数据，2-新数据）
     */
    @Excel(name = "类型", readConverterExp = "1=旧数据,2=新数据")
    @ApiModelProperty(value = "类型（1-旧数据，2-新数据）")
    private Integer type;

    /**
     * 变更ID
     */
    @Excel(name = "变更ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "变更ID")
    @JoinField
    private Long changeId;

    /**
     * 线路ID
     */
    @Excel(name = "线路ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "线路ID")
    private Long lineId;

    /**
     * 线路
     */
    @Excel(name = "线路")
    @ApiModelProperty(value = "线路")
    private String lineCode;

    /**
     * 工序ID
     */
    @Excel(name = "工序ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "工序ID")
    private Long pid;

    /**
     * 工序编码
     */
    @Excel(name = "工序编码")
    @ApiModelProperty(value = "工序编码")
    private String processCode;

    /**
     * 工序名称
     */
    @Excel(name = "工序名称")
    @ApiModelProperty(value = "工序名称")
    private String processName;

    /**
     * 报工方式
     */
    @Excel(name = "报工方式")
    @ApiModelProperty(value = "报工方式")
    private String reportMode;

    /**
     * 工序类型
     */
    @Excel(name = "工序类型")
    @ApiModelProperty(value = "工序类型")
    private String processType;

    /**
     * 工序类型
     */
    @Excel(name = "工序类型")
    @ApiModelProperty(value = "工序类型")
    private String processTypeName;

    /**
     * 待工工时
     */
    @Excel(name = "待工工时")
    @ApiModelProperty(value = "待工工时")
    private BigDecimal waitTime;

    /**
     * 标准工时
     */
    @Excel(name = "标准工时")
    @ApiModelProperty(value = "标准工时")
    private BigDecimal workTime;

    /**
     * 工价
     */
    @Excel(name = "工价")
    @ApiModelProperty(value = "工价")
    private BigDecimal workCost;

    /**
     * 检验方案
     */
    @Excel(name = "检验方案")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "检验方案")
    private Long schemeId;

    /**
     * 检验方案名称
     */
    @Excel(name = "检验方案名称")
    @ApiModelProperty(value = "检验方案名称")
    private String schemeName;

    /**
     * 工艺文件
     */
    @Excel(name = "工艺文件")
    @ApiModelProperty(value = "工艺文件")
    private String processFile;

    /**
     * 顺序
     */
    @Excel(name = "顺序")
    @ApiModelProperty(value = "顺序")
    private Integer sort;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 是否主方案
     */
    @Excel(name = "是否主方案")
    @ApiModelProperty(value = "是否主方案")
    private Boolean isDefault;

    @ApiModelProperty(value = "是否委外")
    private Boolean isOut;

    /**
     * 方案体系
     */
    @Excel(name = "方案体系")
    @ApiModelProperty(value = "方案体系")
    private String planSystem;

    /**
     * 方案编号
     */
    @Excel(name = "方案编号")
    @ApiModelProperty(value = "方案编号")
    private String planCode;

    /**
     * 编号
     */
    @Excel(name = "编号")
    @ApiModelProperty(value = "编号")
    private String code;

    /**
     * 子物料ID
     */
    @Excel(name = "子物料ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "子物料ID")
    private Long bomId;

    /**
     * 子物料名称
     */
    @Excel(name = "子物料名称")
    @ApiModelProperty(value = "子物料名称")
    private String bomName;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @ApiModelProperty(value = "版本号")
    private String version;

    /**
     * 操作状态
     */
    @Excel(name = "操作状态")
    @ApiModelProperty(value = "操作状态:1删除2新增3修改")
    private Integer status;

    @TableField(exist = false)
    private List<LineChangeWork> processWorkList;

    @TableField(exist = false)
    private List<LineChangeTime> processTimeList;

    @TableField(exist = false)
    private List<LineChangeItem> processItemList;

//    @JsonSerialize(using = ToStringSerializer.class)
//    @ApiModelProperty(value = "接收选择的sourceId,会自动转为lastVersionId")
//    @TableField(exist = false)
//    private Long sourceLastVersionId;
}
